Skip to content

Instantly share code, notes, and snippets.

@joepie91
joepie91 / vpn.md
Last active May 18, 2024 07:18
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
# Сначала примеры на реальных данных
/tmp
❯ wget -q https://cve.mitre.org/data/downloads/allitems-cvrf.xml

/tmp 53s
❯ ls -ahl allitems-cvrf.xml      
-rw-r--r-- 1 sergey sergey 345M Jul 26 12:45 allitems-cvrf.xml

/tmp
// programmatic view controller
/*
usage:
override func viewDidLoad() {
super.viewDidLoad()
let newViewController = NewViewController(string: "Hello")
addChildViewController(newViewController, in: view)
}
# This supports merging as many adapters as you want.
# python merge_adapters.py --base_model_name_or_path <base_model> --peft_model_paths <adapter1> <adapter2> <adapter3> --output_dir <merged_model>
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
import os
import argparse
@toxirovvv
toxirovvv / phone_number regex
Created May 18, 2024 06:55
Regex Uzbekistan phone nuber
r"^998([378]{2}|(9[013-57-9]))\d{7}$"
100% works in all Uzbekistan to phone numbers
@ctlllll
ctlllll / longest_chinese_tokens_gpt4o.py
Created May 13, 2024 19:53
Longest Chinese tokens in gpt4o
import tiktoken
import langdetect
T = tiktoken.get_encoding("o200k_base")
length_dict = {}
for i in range(T.n_vocab):
try:
length_dict[i] = len(T.decode([i]))
except:
@DianaEromosele
DianaEromosele / Change "origin" of your GIT repository
Created August 7, 2016 00:31
Change "origin" of your GIT repository
$ git remote rm origin
$ git remote add origin git@github.com:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
@Obydux
Obydux / Fabric-Quilt-Server-Optimization.md
Last active May 18, 2024 06:43
Fabric/Quilt Server Optimization

Fabric/Quilt Server Optimization

This has updated for 1.20.4, all of the optimization mods mentioned here are compatible with each other and don't affect vanilla behaviour by default.

Mods

Lithium - A mod designed to drastically improve the general performance of Minecraft without breaking things.

VMP - A mod designed to improve general server performance at high playercount.